home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.set < prev    next >
Encoding:
Text File  |  1993-01-24  |  18.1 KB  |  441 lines

  1.  
  2.  
  3.                Instructions for setting up INGRES from distribution
  4.                                    (LINUX)  
  5.                    (386BSD)
  6.  
  7.             Brought to you by the folks at
  8.                   Lunar House Software
  9.  
  10.                               (January 12, 1993)  
  11.  
  12.      This set of instructions will help you install INGRES version 8.9
  13.      for LINUX and 386BSD and get it running on your system. The LINUX
  14.      and 386BSD version is distributed as a .lzh archive created using 
  15.      lha 1.0.  
  16.  
  17.  
  18.      1.  Installing INGRES for the first time.
  19.  
  20.          If you already have an INGRES system,  go  directly  to  part
  21.          1.3.
  22.  
  23.          1.1.  Creating a UNIX user called "ingres".
  24.  
  25.              The first thing you should do is to create a  user  named
  26.              "ingres"  on  your  system  and log in as that user.  The
  27.              files  you  read in from  the archive  will  be  owned by
  28.              "ingres", an actual  user on your system.  INGRES locates
  29.              files in  the system by  looking in the  /etc/passwd file
  30.              for  the  user "ingres". INGRES  will not work unless you
  31.              create this user.
  32.  
  33.          1.2.  Creating parent directory for the INGRES system.
  34.  
  35.              The parent directory of the INGRES system at MoonScape is
  36.              "/home/ingres".  It is possible to run INGRES in a parent
  37.              directory of your own choosing, which must be the  parent
  38.              directory   of   the   user   "ingres"  as  specified  in
  39.              /etc/passwd.  For the purpose of this document the parent
  40.              directory will be denoted by "...".
  41.  
  42.          1.3.  Extracting INGRES from the archive.
  43.  
  44.              You are now ready to extract files into your system using
  45.              lha.   You should be in the home directory for INGRES and
  46.              have  the archive ingres??.lzh in it and be  logged in as
  47.              INGRES.  Type the command:
  48.  
  49.                      lha x ingres.lzh
  50.  
  51.              The system will be fully extracted from the archive.
  52.  
  53.          1.4.  User oriented programs
  54.  
  55.              In .../bin there is a collection  of  programs.   Several
  56.              programs  are  type-I commands associated with INGRES and
  57.              which should be moved or linked into /usr/local/bin.  The
  58.              other programs are executed only by other INGRES programs
  59.              and must be left in .../bin. Use the script INSTALL.ME to
  60.              perform that task. Leave the other files where they are!
  61.  
  62.              These are the programs:
  63.  
  64.              copydb, creatdb, destroydb, equel, helpr,
  65.              ingres, printr, purge, restore, sysmod
  66.                        (see INGRES reference manual for an explanation
  67.                        of these commands.
  68.  
  69.              demodb    creates a new database with a name given as  an
  70.                        argument  and  loads  it with sample data rela-
  71.                        tions such as might be  used  by  a  department
  72.                        store  for  employee  and  sales  records.  The
  73.                        INGRES tutorial uses the relations in the  demo
  74.                        database for its examples.
  75.  
  76.              It is imperative that each of these programs  be  in  the
  77.              correct  mode.   A sample "ls -l" is given below.  Verify
  78.              that your file modes agree with the listing.
  79.  
  80.                        -rwx--x--x 1 ingres     . . .   copydb
  81.                        -rws--x--x 1 ingres     . . .   creatdb
  82.                        -rwxr-xr-x 1 ingres     . . .   demodb
  83.                        -rws--x--x 1 ingres     . . .   destroydb
  84.                        -rwx--x--x 1 ingres     . . .   equel
  85.                        -rws--x--x 1 ingres     . . .   helpr
  86.                        -rws--x--x 1 ingres     . . .   ingres
  87.                        -rws--x--x 1 ingres     . . .   printr
  88.                        -rws--x--x 1 ingres     . . .   purge
  89.                        -rws--x--x 1 ingres     . . .   restore
  90.  
  91.  
  92.          1.5.  EQUEL run time library.
  93.  
  94.              The  EQUEL  run   time  library   should    reside     in
  95.              "/usr/local/lib".   The library is  needed  for compiling
  96.              user EQUEL programs. It  is not  necessary for  compiling
  97.              INGRES itself.  It is  preferable although  not essential
  98.              that  the  owner  of  the  library  remain "ingres".  The
  99.              library will be installed by the above INSTALL.ME script.
  100.  
  101.              Refer to the  INGRES  Reference  Manual  for  information
  102.              about how to use EQUEL and the EQUEL library.  There is a
  103.              tutorial on using EQUEL in ".../doc/other/equeltut.q" and
  104.              there     is     a     small     sample     program    in
  105.              ".../doc/other/equeldemo.q".
  106.  
  107.          1.6.  Install concurrency device.
  108.  
  109.          CONCURRENCY CONTROL REMAINS UNTESTED DUE TO THE BETA 
  110.          NATURE OF LINUX TCP/IP.
  111.  
  112.              If you want to use concurrency control, you will have  to
  113.              install the INGRES concurrency program into /etc, add the
  114.              command  to  /etc/rc,   and   add   the   definition   to
  115.              /etc/inet/services*.  You   should    read  the document 
  116.          "Instructions  for  Installing  the  INGRES   Concurrency
  117.          Device  in UNIX" before proceeding.
  118.  
  119.          *Or where-ever 'services' lives.
  120.  
  121.      2.  General Information about INGRES.
  122.  
  123.          2.1.  Some comments on the INGRES directories
  124.  
  125.              The directories (in ...) necessary for a minimal  running
  126.              system are:
  127.  
  128.              bin             the binary programs comprising INGRES
  129.              files           files used by various parts of INGRES
  130.              data/base/      user-created databases
  131.              demo            used by the "demodb" command
  132.  
  133.              Several additional directories are also created. If space
  134.              limitations  are a problem on your system you may want to
  135.              delete some or all of the material here.  If you need to,
  136.              delete  the  files  but  be sure to keep the directories.
  137.              The additional directories are:
  138.  
  139.              doc             documentation
  140.              lib             object file libraries
  141.              source          system source code
  142.  
  143.      3.  Getting started using INGRES.
  144.  
  145.          3.1.  The Users File.
  146.  
  147.              In order to use INGRES a user must be  entered  into  the
  148.              "users"  file.   The  users file contains information re-
  149.              garding the status and permissions of  each  user.   This
  150.              file  resembles  the  /etc/passwd  file, and includes the
  151.              user's name, the user code (used inside INGRES to identi-
  152.              fy  a  user),  the UNIX id of the user, some status bits,
  153.              and some other fields.  These are described in detail  in
  154.              the document users(files).
  155.  
  156.              The users file can be initialized by running  the  "user-
  157.              setup"  program.   This program installs all users in the
  158.              /etc/passwd file as valid INGRES users.  The user code is
  159.              assigned sequentially from "aa".  The status field is in-
  160.              itialized to 000000 for all normal users and  177777  for
  161.              the user "ingres".
  162.  
  163.              To setup the users file in ingres/files execute:
  164.  
  165.                      .../bin/usersetup
  166.  
  167.              Once created the users file can be edited using  "vi"  to
  168.              do the following things:
  169.  
  170.                      - completely remove all users not  authorized  to
  171.                      execute INGRES.
  172.  
  173.                      - restrict a user from using a  particular  data-
  174.                      base.
  175.  
  176.                      - set  the  other  status  bits  for  appropriate
  177.                      users.
  178.  
  179.              As UNIX users are added or deleted, the users  file  must
  180.              be  updated  appropriately.  The usersetup program can be
  181.              executed only once.  A diagnostic is issued if it is exe-
  182.              cuted a second time.
  183.  
  184.          3.2.  Creating a Sample Data Base
  185.  
  186.              The "demodb" command provided can be  used  to  construct
  187.              the sample database on which the examples in the tutorial
  188.              (located on-line in ".../doc/other/tutorial") are  based.
  189.              In order to execute this command you must be entered into
  190.              the users file and have permission to create a  database.
  191.              To  create  the  sample  database  and assign it the name
  192.              "demo" type the command:
  193.  
  194.                      demodb demo -c
  195.  
  196.              In order to use INGRES with this database you need merely
  197.              type
  198.  
  199.                      ingres demo
  200.  
  201.              and you will be ready  to  follow  the  terminal  session
  202.              described  in  the  tutorial  or  to  formulate  your own
  203.              queries.
  204.  
  205.              To create your own copy of the same sample  database  use
  206.              some unique database name.
  207.  
  208.                      demodb mydemo -c
  209.  
  210.          N.B.  the -c is very important as it bypasses the locking
  211.          driver.
  212.  
  213.          3.3.  Creating Other Data Bases.
  214.  
  215.              You will no doubt wish to create other databases of  your
  216.              own and for this you will need to use "creatdb".  In ord-
  217.              er to use this command you  must  be  authorized  in  the
  218.              users file.
  219.  
  220.          3.4.  Concurrency Control.
  221.  
  222.              INGRES is designed to run with either no concurrency con-
  223.              trol or with full concurrency control.  INGRES locks por-
  224.              tions of a database by using a user level process  called
  225.              /etc/ingreslock.   Initially  you  can use INGRES without
  226.              this special process.  If you  want  concurrency  control
  227.              (if more than one person will be using INGRES on the same
  228.              database at the same time, you MUST have it) then print a
  229.              copy of the instructions on how to install the concurren-
  230.              cy device:
  231.  
  232.                      more .../doc/other/lockdev.doc
  233.  
  234.  
  235.      4.  Hints and suggestions.
  236.  
  237.  
  238.          4.1.  Unix Protection Problems.
  239.  
  240.              If you encounter  problems  in  creating  directories  or
  241.              reading  in  files  from  the  tape  check the protection
  242.              status of the parent directories involved  to  make  sure
  243.              that permission to write new files exists.
  244.  
  245.              The following summarizes the proper modes for each direc-
  246.              tory.  All directories are owned by INGRES except the in-
  247.              dividual databases.  (The modes in parentheses  represent
  248.              the  mode to be used if you wish to restrict access maxi-
  249.              mally.)
  250.  
  251.                      bin             755
  252.                      data            700
  253.                      data/base       777
  254.                      demo            755
  255.                      doc             755
  256.                      files           755
  257.                      lib             755
  258.                      source and all its subdirectories       755 (700)
  259.                      any database    777 (typically owned by the dba)
  260.  
  261.              You will need  to  become  super-user  to  add  files  in
  262.              "/usr/local/bin".
  263.  
  264.  
  265.      5.  Source code and system regeneration
  266.  
  267.          5.1.  Log on as user "ingres".
  268.  
  269.              When doing any system work always log on as "ingres".
  270.  
  271.          5.2.  Recompilation.
  272.  
  273.                There's a file .../source/Config which contains some
  274.          important configuration flags.  Please read and modify as
  275.          necessary if you try to compile ingres on platforms other
  276.          than Linux.
  277.  
  278.              All source code for the system is located in ".../source"
  279.              and various sub-directories therein. Each subdirectory is
  280.              named for a functional component or sub-component of  the
  281.              system.   Makefiles for regenerating the various portions
  282.              of the system from source are located in  the  associated
  283.              directory.   To  regenerate  a  particular  module  (e.g.
  284.              parser) say:
  285.  
  286.                      cd .../source/parser
  287.                      make
  288.  
  289.              The entire system can  be  recompiled  and  installed  in
  290.              /usr/local/bin using the command:
  291.  
  292.                      cd .../source/conf
  293.                      make allinstall
  294.              cd 
  295.              ./INSTALL.ME 
  296.  
  297.              When recompiling for the first time it  is  strongly  ad-
  298.              vised  that you keep a  log by doing the following:
  299.  
  300.                      make allinstall 2>&1 |tee log
  301.  
  302.              Libraries of object code are maintained in .../lib.
  303.  
  304.          N.B. bison -y chokes on .../source/equel/grammar.y
  305.          I have no idea why. I use byacc. It works fine.
  306.  
  307.  
  308.          5.3.  Compilation Flags and Funny Flavored UNIXes.
  309.  
  310.              (N.B. THIS section is out of date)
  311.              If you are running any system other than VM/UNIX  release
  312.              4.2 (4.2BSD), you may have to recompile the INGRES system
  313.              before it is usable.  Examine the file  .../source/unix.h
  314.              closely  for correspondence with your version of reality.
  315.              Major problems include representation of user  and  group
  316.              id's and structures returned by various system calls.
  317.  
  318.              Four compile flags in unix.h define the type of user id's
  319.              used  on  your  system.  For a vanilla version six system
  320.              with 8-bit user  id's  and  8-bit  group  id's,  set  the
  321.              xV6_UNIX  compilation  flag.   For a Berkeley version six
  322.              system with a single 16-bit user id (and  no  group  id),
  323.              set  the  xB_UNIX flag.  For a vanilla version seven sys-
  324.              tem, chocolate version six  system,  or  VM/UNIX  system,
  325.              with 16-bit user id's and 16-bit group id's set xV7_UNIX.
  326.              Also, define either VAX or PDP11 depending on whether you
  327.              are on a PDP-11 or a VAX.
  328.  
  329.              A large set of flags in ingres.h control  compilation  of
  330.              trace  information  and  timing  estimates.  Flags of the
  331.              form "x?TM" (where "?" is a letter  as  described  below)
  332.              turn  on timing information.  THESE SHOULD ALWAYS BE LEFT
  333.              OFF, since the system you  receive  on  the  distribution
  334.              tape does not include everything necessary to successful-
  335.              ly use these flags.  Flags of the form "x?TR1",  "x?TR2",
  336.              and "x?TR3" are trace compilation flags.  Compiling these
  337.              in does not automatically make trace  information  print,
  338.              but only makes it available.  These flags must be proper-
  339.              ly nested; for example, if xMTR2 is set, xMTR1 must  also
  340.              be  set  (but  xMTR3  is optional).  The letter codes for
  341.              these flags are as follows:
  342.  
  343.                   A       Access Methods
  344.                   M       Terminal Monitor
  345.                   P       Parser
  346.                   Q       Qrymod
  347.                   D       Decomposition
  348.                   O       One Variable Query Processor
  349.                   Z       Data Base Utilities
  350.                   E       Equel
  351.                   S       Scanner
  352.                   T       Standalone Routines
  353.  
  354.              A flag named DISTRIB is used in some places in the  code.
  355.              This  is  used  in  the yet-to-be-born Distributed INGRES
  356.              system, and should always be left off.
  357.  
  358.              Touching any other defined constants should be considered
  359.              extremely  dangerous  and  is  done  strictly at your own
  360.              risk.
  361.  
  362.  
  363.      6.  Documentation.
  364.  
  365.          6.1.  Tutorial on INGRES.
  366.  
  367.              (N.B. Docs were formatted by hand and may not be complete)
  368.              A  tutorial   on   using   INGRES   can    be   found   in
  369.              ".../doc/other/tutorial.doc".  A  copy of the document can
  370.              be viewed by:
  371.  
  372.                      more .../doc/other/tutorial.doc
  373.  
  374.              The tutorial guides the reader through examples of  using
  375.              QUEL  the  INGRES  database language. A basic familiarity
  376.              with UNIX is assumed.
  377.  
  378.          6.2.  Reference Manual.
  379.  
  380.              The reference manual consists of a number of files -  one
  381.              for  each  command  or  feature  in INGRES. The reference
  382.              manual can be retrieved by using the  help  command  (see
  383.              help(quel)).  
  384.  
  385.          6.3.  Maintenance Manual.
  386.  
  387.              A guide to using INGRES has been written  and  is  called
  388.              "Creating  and  Maintaining a Database Using INGRES".  It
  389.              includes information about  creating  databases,  storage
  390.              structures,  recovery, copy, indices and other useful in-
  391.              formation.  A copy of the manual can be produced by:
  392.  
  393.                      more .../doc/other/maintain.doc
  394.  
  395.  
  396.          6.4.  Design of INGRES
  397.  
  398.              A draft of the report "The Design and  Implementation  of
  399.              INGRES"  by  Stonebraker,  Kreps and Held can be found in
  400.              ".../doc/other/design.doc". It can be printed by:
  401.  
  402.                      lp .../doc/other/design.doc
  403.  
  404.              The report gives a fairly  detailed  description  of  the
  405.              structure and capabilities of the entire system as it ex-
  406.              isted over eight years ago, in January 1976.  It  is  out
  407.              of  date  in many areas.  It gives implementation details
  408.              and algorithms of important system modules.
  409.  
  410.  
  411.          6.5.  Internal Documentation.
  412.  
  413.              We currently do not provide,  nor  have  we  written  any
  414.              internal  documentation  beyond  what is mentioned in the
  415.              "Design and Implementation" paper.
  416.  
  417.  
  418.      7.  Consulting
  419.  
  420.          The INGRES project is not set up to supply  regular  consult-
  421.          ing.   If  you do have problems, please reread these instruc-
  422.          tions carefully; over two thirds of the "bug reports" we  re-
  423.          ceive  can  be answered by re-reading the documentation.  For
  424.          non-technical questions (e.g., regarding availability of  the
  425.          system or documentation) please call the project secretary at
  426.          (415) 642-2344.  I can also be reached through this number.
  427.  
  428.  
  429.                Joe Kalash
  430.                Electronics Research Laboratory
  431.                University of California
  432.                Berkeley, California  94720
  433.  
  434.  
  435.      8.  Linux and 386BSD port
  436.  
  437.         The linux/386BSD port was done by:
  438.         Zeyd M. Ben-Halim               
  439.         zmbenhal@netcom.com
  440.  
  441.